package org.ljy.testdemo.interceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

//@Configuration
//public class AppInterceptorConfigurer implements WebMvcConfigurer {
//
//    @Autowired
//    private LoginInterceptor loginInterceptor;//给保安们注入拦截规则
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(loginInterceptor)//该方法是注册，也就是执行拦截规则
//                .addPathPatterns("/**")//该方法表示拦截所有的请求
//                .excludePathPatterns("/login");//表示该页面不进行拦截
//    }
//}
